<html lang="zh-CN">
<head>
    <style type="text/css">@charset "UTF-8";
    [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak, .ng-hide:not(.ng-hide-animate) {
        display: none !important;
    }
    ng\:form {
        display: block;
    }</style>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <meta content="telephone=no" name="format-detection">
    <title>{$title}</title>
    <link data-turbolinks-track="true" href="{RES}/mobile/diandan/assets/diandanbao/weixin.css" media="all" rel="stylesheet">
    <style type="text/css">@media screen {
        .smnoscreen {
            display: none
        }
    }
    @media print {
        .smnoprint {
            display: none
        }
    }</style>
    {php echo register_jssdk(false);}
</head>
<body>
<div ng-view="" style="height: 100%;" class="ng-scope">
    <div class="ddb-nav-header ng-scope" common-header="">
        <div class="nav-left-item" onclick="location.href='{php echo $this->createMobileUrl('waplist', array('storeid' => $item['id']), true);}';"><i class="fa fa-angle-left"></i></div>
        <div class="header-title ng-binding">{$title}</div>
    </div>
    <!--footer-->
    {php include $this->template('diandan/_footer');}
    <div id="ddb-branch-show" class="main-view ng-scope">
        <div class="avatar-part">
            <div class="avatar" onclick="toMenu();">
                <img src="{php echo tomedia($item['logo']);}">
            </div>
            <div class="branch-info">
                <div class="name ng-binding" onclick="toMenu();">{$title}</div>
                <div class="comments-level red">
                    <div ng-rating="branch.rating" class="ng-isolate-scope">
                        <?php for($i=0;$i < $item['level']; $i++){ ?>
                        <i class="fa fa-star-o ng-scope"></i>
                        <?php }?>
                    </div>
                </div>
                <div class="facilities ng-scope">
                    {if $item['enable_wifi']==1}
                    <span class="facility ng-scope">
                        <i class="fa fa-wifi"></i> 支持Wifi
                    </span>
                    {/if}
                    {if $item['enable_park']==1}
                    <span class="facility ng-scope">
                        <i class="fa fa-paypal"></i> 停车位
                    </span>
                    {/if}
                    {if $item['enable_room']==1}
                    <span class="facility ng-scope">
                        <i class="fa fa-slideshare"></i> 包厢
                    </span>
                    {/if}
                    {if $item['enable_card']==1}
                    <span class="facility ng-scope">
                        <i class="fa fa-credit-card"></i> 刷卡
                    </span>
                    {/if}
                </div>
                <div class="average-consume">
                    {if !empty($item['consume'])}
                    <span class="red ng-binding">￥{$item['consume']}</span>/人
                    {/if}
                    <span class="button collection {if empty($collection)}border-green{/if}">

                        <span class="ng-scope">{if empty($collection)}收藏{else}已收藏{/if}</span>
                    </span>
                </div>
            </div>
        </div>
        {if !empty($item['announce'])}
        <div class="notification-section">
            <div class="notice">
                <i class="fa fa-volume-up red"></i>
                <marquee behavior="alternate" scrollamount="1" scrolldelay="1" class="ng-binding">{$item['announce']}</marquee>
            </div>
        </div>
        {/if}
        <div class="space-12"></div>
        <div class="space-12"></div>
        <div class="intro-section">
            <a class="branch-item arrow-right" href="{php echo $this->createMobileUrl('detailcontent', array('id' => $id), true)}">
                <div class="gray icon">
                    <i class="fa fa-clock-o gray"></i>
                </div>
                <div class="label">门店详情</div>
            </a>
            <div class="location-label">
                <div class="gray icon">
                    <i class="fa fa-map-marker"></i>
                </div>
                <div class="address ng-binding">{$item['address']}</div>
                <div class="red phone">
                    <a href="tel:{$item['tel']}"><i class="fa fa-phone"></i></a>
                </div>
                <div class="red location-address">
                    <a href="http://api.map.baidu.com/marker?location={$item['lat']},{$item['lng']}&title={$item['title']}&content={$item['address']}&output=html&src=wzj|wzj" style="color:#ef4437;"><i class="fa fa-map-marker"></i></a>
                </div>
            </div>
            <div class="branch-item">
                <div class="gray icon">
                    <i class="fa fa-clock-o gray"></i>
                </div>
                <span class="label">营业时间：</span><span class="ng-binding ng-scope">{$item['begintime']}~{$item['endtime']}</span>
            </div>
        </div>
        <div class="space-12"></div>
    </div>
</div>

<div ng-alert-dialog="" ng-show="alert_content" class="ng-isolate-scope"><!-- ngIf: show --></div>
<div id="ddb-loading" style="display: none;"><i class="fa fa-spinner fa-spin"></i></div>

<div ng-confirm-dialog="" ng-title="请确认已到店" ng-confirm="scanQrCode('请对准桌子上的二维码进行扫描')"
     ng-cancel="toggle_show_eat_in_hall_select()" ng-show="show_eat_in_hall_select" ng-confirm-text="扫码下单"
     ng-cancel-text="待会下单" class="ng-isolate-scope">
</div>

<!-- password_modal -->
<div ng-confirm-dialog="" ng-title="请输入支付密码" ng-confirm="password_modal.authenticate()"
     ng-cancel="password_modal.close()" ng-show="password_modal.show" ng-confirm-text="确定" ng-cancel-text="取消"
     class="ng-isolate-scope ng-hide"><!-- ngIf: show --></div>

<!-- confirm_modal -->
<div ng-confirm-dialog="" ng-title="" ng-confirm="confirm_modal.confirm()" ng-cancel="confirm_modal.cancel()"
     ng-show="confirm_modal.show" ng-confirm-text="" ng-cancel-text="" class="ng-isolate-scope ng-hide">
    <!-- ngIf: show --></div>

<script>
    function toggleFavorite() {
        alert('debug');
    }

    function toMenu() {
        var url = "{php echo $this->createMobileUrl('waplist', array('storeid' => $item['id']), true);}";
        location.href = url;
    }
</script>
<script src="{RES}/mobile/diandan/assets/diandanbao/jquery-1.11.3.min.js"></script>
<script language="javascript">
    $('.collection').click(function () {
        var url = "{php echo $this->createMobileUrl('SetCollection', array('id' => $id), true);}";
        $.ajax
        ({
            url: url,
            type:'POST',
            data: {},
            dataType:'json',
            error: function () {
                alert('网络通讯异常，请稍后再试！');
            },
            success: function (result) {
                if (result.status == 1) {
                    $(".collection").removeClass('border-green');
                    $(".collection > .ng-scope").html('已收藏');
                } else {
                    $(".collection").addClass('border-green');
                    $(".collection > .ng-scope").html('收藏');
                }
            }
        });

//        alert('debug');

//        $(".collection").addClass('ng-hide').eq($('.ddb-tab-bar .ddb-tab-item').index(this)).removeClass('ng-hide');

    });

    $('.btn-eat-room').click(function () {
//        if (confirm('请对准桌子上的二维码进行扫描')) {
//            wx.scanQRCode({
//                needResult: 1, // 默认为0，扫描结果由微信处理，1则直接返回扫描结果，
//                scanType: ["qrCode", "barCode"], // 可以指定扫二维码还是一维码，默认二者都有
//                success: function (res) {
//                    var result = res.resultStr; // 当needResult 为 1 时，扫码返回的结果
//                }
//            });
//        }
    });


    $('.ddb-box').click(function () {
//        $(".filter-nav-menu > .ddb-nav-pane").addClass('ng-hide').eq($('.ddb-tab-bar .ddb-tab-item').index(this)).addClass('ng-hide');
//        $(".ddb-box").addClass('ng-hide');
    });
</script>
</body>
</html>